﻿<p>Add Your Location</p>
<form>
    <p>Please Enter The following:</p>
    <p>
        Name:
        <input type="text" id="FirstName" size="10" placeholder="first" required="required" />
        <input type="text" id="LastName" size="10" placeholder="last" required="required" />
    </p>
  @*  <p>
        Degree:
        <input type="text" id="Degree" size="30" placeholder="" required="required" />
    </p>
  <p>
        Graduation Year:
        <input type="text" id="graduationYear" size="10" placeholder="dropdown" required="required" />
    </p>
    <p>
        Occupation:
        <input type="text" id="occupation" size="10" placeholder="" required="required" />
    </p>
    <p>Address:</p>
    <input type="text" id="Street" size="40" placeholder="Street" required="required" />
    <input type="text" id="City" size="30" placeholder="City" required="required" />
    <select name="State" id="state" required="required">
        <option value="" selected="selected">Select a State</option>
        <option value="AL">Alabama</option>
        <option value="AK">Alaska</option>
        <option value="AZ">Arizona</option>
        <option value="AR">Arkansas</option>
        <option value="CA">California</option>
        <option value="CO">Colorado</option>
        <option value="CT">Connecticut</option>
        <option value="DE">Delaware</option>
        <option value="DC">District Of Columbia</option>
        <option value="FL">Florida</option>
        <option value="GA">Georgia</option>
        <option value="HI">Hawaii</option>
        <option value="ID">Idaho</option>
        <option value="IL">Illinois</option>
        <option value="IN">Indiana</option>
        <option value="IA">Iowa</option>
        <option value="KS">Kansas</option>
        <option value="KY">Kentucky</option>
        <option value="LA">Louisiana</option>
        <option value="ME">Maine</option>
        <option value="MD">Maryland</option>
        <option value="MA">Massachusetts</option>
        <option value="MI">Michigan</option>
        <option value="MN">Minnesota</option>
        <option value="MS">Mississippi</option>
        <option value="MO">Missouri</option>
        <option value="MT">Montana</option>
        <option value="NE">Nebraska</option>
        <option value="NV">Nevada</option>
        <option value="NH">New Hampshire</option>
        <option value="NJ">New Jersey</option>
        <option value="NM">New Mexico</option>
        <option value="NY">New York</option>
        <option value="NC">North Carolina</option>
        <option value="ND">North Dakota</option>
        <option value="OH">Ohio</option>
        <option value="OK">Oklahoma</option>
        <option value="OR">Oregon</option>
        <option value="PA">Pennsylvania</option>
        <option value="RI">Rhode Island</option>
        <option value="SC">South Carolina</option>
        <option value="SD">South Dakota</option>
        <option value="TN">Tennessee</option>
        <option value="TX">Texas</option>
        <option value="UT">Utah</option>
        <option value="VT">Vermont</option>
        <option value="VA">Virginia</option>
        <option value="WA">Washington</option>
        <option value="WV">West Virginia</option>
        <option value="WI">Wisconsin</option>
        <option value="WY">Wyoming</option>
    </select>
    <input type="text" id="Zip" size="5" placeholder="zipcode" required="required" />
    
    <input type="text" id="jobTitle" size="40" placeholder="jobTitle" required="required" />
    <input type="text" id="isAlumni" size="40" placeholder="isAlumni" required="required" />
    <input type="text" id="jobtitle" size="40" placeholder="jobtitle" required="required" />
    <input type="text" id="Email" size="40" placeholder="email" required="required" />
    <input type="text" id="PhoneNumber" size="40" placeholder="phone" required="required" />*@
    <input type="button" value="submit" onclick="dataSubmiter()" />
</form>

<script type="text/javascript">

    function dataSubmiter() {
        var newContact = {};
        $(':text').each(
            function ()
            {
                newContact[this.id] = this.value;
            }
        );
        //   NewContact["test"] = 
    //    var NewContactDTO = { 'NewContact': NewContact };
        //var inputString = {
        //    FirstName: $("#firstName").val(),
        //    LastName: $("#lastName").val(),
        //    Address: $("#street").val(),
        //    City: $("#city").val(),
        //    State: $("#state option:selected").val(),
        //    Zip: $("#zipcode").val(),
        //    Email: $("#email").val(),
        //    Phone: $("#phone").val(),
        //    Degree:$("#degree").val()
        //};

        var sourceUrl = " @Url.Action("AddNewContact", "Home") "; 
       // var inputJson = JSON.stringify(inputString);

        //the ajax call is a Json object
        $.ajax({
            type: "Post",
            url: sourceUrl,
            contentType: "application/json; charset=utf-8",
            data: JSON.stringify(newContact),
            success: function (sum) { alert(sum); },
            failure: function () { alert("failed"); }
        });
        alert(emailurl);
    }

</script>

@{
    
    

}